package net.knightwatch.kwtools.database;

import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class PhotoQuestionTable {
	private static final String TAG = "PhotoQuestionTable";
	public static final String TABLE_PHOTO_QUESTIONS = "PhotoQuestions";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_QUESTION_ID = "questionId";
	public static final String COLUMN_EXAMPLE_PHOTO = "examplePhoto";
	public static final String COLUMN_DIRECTIONS = "directions";
	// Database create statement
	private static final String DATABASE_CREATE = "CREATE TABLE "
			+ TABLE_PHOTO_QUESTIONS
			+ " ( "
			+ COLUMN_ID + " integer primary key autoincrement,"
			+ COLUMN_QUESTION_ID + " integer not null,"
			+ COLUMN_EXAMPLE_PHOTO + " blob,"
			+ COLUMN_DIRECTIONS + " text"
			+ ");";
	
public static void onCreate(SQLiteDatabase database) {
		
		try {
			Log.i(TAG, DATABASE_CREATE);
			database.execSQL(DATABASE_CREATE);
		} catch (SQLException e) {
			// try to make the table
			Log.e(TAG, "Unable to create table");
			e.printStackTrace();
		} finally {
			Log.i(TAG, "Table "+TABLE_PHOTO_QUESTIONS+" has been created.");
		}
	}
	public static void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion){
		
	}
}
